package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stone
 * @date 2022/07/11 17:14
 */
@RequestMapping("json")
//@Controller
//@ResponseBody // 该Controller组件下所有的Handler方法都响应Json
@RestController
public class JsonController {

    @RequestMapping("hello")
    //@ResponseBody
    public BaseRespVo hello() {
        return BaseRespVo.ok("hello json");
    }
    @RequestMapping("goodbye")
    //@ResponseBody
    public BaseRespVo goodbye() {
        return BaseRespVo.ok("byebye json");
    }
}
